package com.qcrud.tookit;

import com.qcrud.annotation.Param;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public class SqlParamUtils {

    public static List<Param> getSqlParams(Method method) {
        List<Param> sqlParams = new ArrayList<>();
        Annotation[][] anArr = method.getParameterAnnotations();
        for (Annotation[] ans : anArr) {
            for (Annotation an : ans) {
                if (an instanceof Param) {
                    sqlParams.add((Param) an);
                }
            }
        }
        return sqlParams;
    }
}
